const middleware = require('hm-middleware');

module.exports = {
    publicPath: '/rems/applicant',

    devServer: {
        after: function (app, server) {
            // 如果仅仅使用 http mock，这样写就可以了
            app.use(middleware({
                mockRules: {
                    '/': '.data'
                },
                // 如果需要支持 websocket，需要提供下面的选项
                websocket: {
                    server: server || this,
                    encodeMessage: function () {
                    },
                    decodeMessage: function () {
                    }
                }
            }));
        }
    }, // devServer

    configureWebpack: config => {
        require('vux-loader').merge(config, {
            options: {},
            plugins: ['vux-ui']
        });
    }
};
